package suanzi.core.db.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import suanzi.core.db.entity.SysDatabase;
import suanzi.core.db.mapper.SysDatabaseMapper;
import suanzi.core.db.service.ISysDataBaseService;


@Service
public class ISysDataBaseServiceImpl implements ISysDataBaseService {

    @Autowired
    private SysDatabaseMapper sysDatabaseMapper;


    @Cacheable(cacheNames = "dateSource#60000",key = "#companyId")
    public SysDatabase getDateSourceCache(String companyId) throws Exception {
        SysDatabase dateBase=sysDatabaseMapper.getDateSource(companyId);

        return dateBase;
    }

    public SysDatabase getDateSource(String companyId) throws Exception {
        SysDatabase dateBase=sysDatabaseMapper.getDateSource(companyId);
        return dateBase;
    }
}

